﻿#ifndef CDragPreviewWidget_H
#define CDragPreviewWidget_H
#include <qlabel.h>
#include <QDrag>
#include <QMimeData>
class CDragPreviewWidget :
	public QLabel
{
	Q_OBJECT
public:
	CDragPreviewWidget(QString sGuid, QString sCardGuid, QString sDllName, int nDeviceType, QWidget *pWidget,int nIndex=0, QWidget *parent = nullptr);
	~CDragPreviewWidget();
	void setIndex(int nIndex);   //设置序号
	void setGuid(QString sId);
	QString m_sDllName;   //dll名称
	int m_nDeviceType;    //设备类型
protected:
	void mousePressEvent(QMouseEvent *event) override;
private:
	void setTitel();   //设置标题
private:
	QString m_sGuid;
	QString m_sCardGuid;
	QPixmap m_pixmap;
	QDrag *m_pDrag;
	QMimeData *m_pMimeData;
	QWidget *m_pWidget;
	QString m_sCardqssStr;   //卡片样式表
	int m_nRow;  //网络 行
	int m_nCol;  //网格 列
	int m_nIndex; //在网格里面的序号 防止有两个一样的  拖拽移到位置出错
};

#endif